<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	xmlns:th="http://www.thymeleaf.org" layout:decorator="common/layout">
<head>
<meta charset="UTF-8" />
<title>后台管理 | 汽车列表</title>
<link rel="stylesheet" type="text/css" href="css/pager/pager_blue.css" />
</head>
<body>
	<section layout:fragment="content-header">
		<h1>
			<i class="fa fa-car fa-fw"></i>汽车管理<small></small>
		</h1>
		<ol class="breadcrumb">
			<li><a href="/"><i class="fa fa-dashboard"></i>首页</a></li>
			<li class="active">汽车列表</li>
		</ol>
	</section>
	<section layout:fragment="content">
		<!-- row -->
		<div class="row">
			<div class="col-xs-12">
				<div class="box">
					<div class="box-header with-border">
						<h3 class="box-title">汽车列表</h3>
					</div>
					<!-- /.box-header -->
					<div class="box-body">
						<div id="example1_wrapper"
							class="dataTables_wrapper form-inline dt-bootstrap">
							<!-- filter -->
							<div class="row">
								<div class="col-xs-12 mt5 mb15">
									<div class="pull-left">
										<button type="button" class="btn btn-block btn-danger"
											onclick="batchSave();"><i class="fa fa-save"></i> 批量保存</button>
									</div>
									<div class="dataTables_filter pull-right">
										<div class="col-sm-8">
											<div class="form-group has-feedback">
												<input type="text" name="query" th:value="${query}"
													class="form-control" placeholder="请输入关键词搜索" /><span
													class="fa fa-search form-control-feedback"></span>
											</div>
										</div>
										<div class="col-sm-4 pull-right text-right">
											<button type="button" class="btn btn-info" id="query">搜索</button>
										</div>
									</div>
								</div>
							</div>
							<!-- list -->
							<div class="row">
								<div class="col-sm-12">
									<table id="grid"
										class="table table-bordered table-striped font14" role="grid"
										aria-describedby="info">
										<thead>
											<tr role="row">
												<th rowspan="1" colspan="1">ID</th>
												<th rowspan="1" colspan="1">检索字母</th>
												<th rowspan="1" colspan="1">品牌</th>
												<th rowspan="1" colspan="1">车系</th>
												<th rowspan="1" colspan="1">名称</th>
												<th rowspan="1" colspan="1">简称</th>
												<th rowspan="1" colspan="1">参考价格</th>
												<th rowspan="1" colspan="1"></th>
											</tr>
										</thead>
										<tbody id="list">
											<tr role="row" class="odd" th:each="car:${lst}">
												<td th:text="${car.id}">id</td>
												<td th:text="${car.alphabet}">alphabet</td>
												<td th:text="${car.brand}">brand</td>
												<td th:text="${car.series}">series</td>
												<td th:text="${car.name}">name</td>
												<td class="edit-sname">
													<div class="input-group input-group-sm">
														<input type="text" name="sname" class="form-control"
															th:value="${car.sname}" /> <span class="input-group-btn">
															<a class="btn btn-block btn-success btn-sm save" th:attr="data-carid=@{${car.id}},data-sname=@{${car.sname}}">
																<i class="fa fa-save"></i>
															</a>
														</span>
													</div>
												</td>
												<td th:inline="text">￥[[${#numbers.formatDecimal(car.refprice,
													0, 'COMMA', 2, 'POINT')}]]</td>
												<td><a class="dt-edit" th:href="@{'/cars/edit/'+${car.id}}"><i class="fa fa-edit"></i> 详情</a></td>
											</tr>
										</tbody>
										<tfoot th:if="${gridPaging.totalRecord}==0">
											<tr>
												<td rowspan="1" colspan="8" class="text-center">数据为空</td>
											</tr>
										</tfoot>
									</table>
								</div>
							</div>
							<!-- pagination -->
							<div class="row">
								<div class="col-xs-12">
									<div class="pull-left">
										<button type="button" class="btn btn-danger"
											onclick="batchSave();"><i class="fa fa-save"></i> 批量保存</button>
									</div>
									<div class="pull-right">
										<div role="pagination" class="mr35" id="kkpager"
											th:attr="data-page=@{${gridPaging.page}},data-total-page=@{${gridPaging.totalPage}},data-total-record=@{${gridPaging.totalRecord}}">
										</div>
									</div>
								</div>
							</div>
							<!-- /.pagination -->
						</div>
					</div>
					<!-- /.box-body -->
				</div>
			</div>
		</div>
		<!-- /.row -->
	</section>
	<!-- own js -->
	<section layout:fragment="js">
		<script th:src="@{/js/pager/pager.js}"></script>
		<script th:src="@{/js/cars/index.js}"></script>
	</section>
</body>
</html>